--
-- PostgreSQL database dump
--

-- Started on 2011-04-02 14:32:54

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 7 (class 2615 OID 24651)
-- Name: acl; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA acl;


ALTER SCHEMA acl OWNER TO postgres;

--
-- TOC entry 8 (class 2615 OID 32949)
-- Name: menu; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA menu;


ALTER SCHEMA menu OWNER TO postgres;

--
-- TOC entry 337 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = acl, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1533 (class 1259 OID 24683)
-- Dependencies: 7
-- Name: acl_action; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_action (
    action_id integer NOT NULL,
    action_name character varying(150) NOT NULL,
    controller_id integer NOT NULL
);


ALTER TABLE acl.acl_action OWNER TO postgres;

--
-- TOC entry 1532 (class 1259 OID 24681)
-- Dependencies: 1533 7
-- Name: acl_action_action_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_action_action_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_action_action_id_seq OWNER TO postgres;

--
-- TOC entry 1878 (class 0 OID 0)
-- Dependencies: 1532
-- Name: acl_action_action_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_action_action_id_seq OWNED BY acl_action.action_id;


--
-- TOC entry 1879 (class 0 OID 0)
-- Dependencies: 1532
-- Name: acl_action_action_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_action_action_id_seq', 2, true);


--
-- TOC entry 1531 (class 1259 OID 24670)
-- Dependencies: 7
-- Name: acl_controller; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_controller (
    controller_id integer NOT NULL,
    controller_name character varying(255) NOT NULL,
    module_id integer NOT NULL
);


ALTER TABLE acl.acl_controller OWNER TO postgres;

--
-- TOC entry 1530 (class 1259 OID 24668)
-- Dependencies: 7 1531
-- Name: acl_controller_controller_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_controller_controller_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_controller_controller_id_seq OWNER TO postgres;

--
-- TOC entry 1880 (class 0 OID 0)
-- Dependencies: 1530
-- Name: acl_controller_controller_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_controller_controller_id_seq OWNED BY acl_controller.controller_id;


--
-- TOC entry 1881 (class 0 OID 0)
-- Dependencies: 1530
-- Name: acl_controller_controller_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_controller_controller_id_seq', 2, true);


--
-- TOC entry 1529 (class 1259 OID 24662)
-- Dependencies: 7
-- Name: acl_module; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_module (
    module_id integer NOT NULL,
    module_name character varying(255) NOT NULL
);


ALTER TABLE acl.acl_module OWNER TO postgres;

--
-- TOC entry 1528 (class 1259 OID 24660)
-- Dependencies: 7 1529
-- Name: acl_module_module_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_module_module_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_module_module_id_seq OWNER TO postgres;

--
-- TOC entry 1882 (class 0 OID 0)
-- Dependencies: 1528
-- Name: acl_module_module_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_module_module_id_seq OWNED BY acl_module.module_id;


--
-- TOC entry 1883 (class 0 OID 0)
-- Dependencies: 1528
-- Name: acl_module_module_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_module_module_id_seq', 3, true);


--
-- TOC entry 1535 (class 1259 OID 24696)
-- Dependencies: 7
-- Name: acl_permission; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_permission (
    permission_id integer NOT NULL,
    permission_obs character varying(255) NOT NULL,
    role_id integer NOT NULL,
    module_id integer NOT NULL,
    controller_id integer NOT NULL,
    action_id integer NOT NULL,
    resource_id integer NOT NULL
);


ALTER TABLE acl.acl_permission OWNER TO postgres;

--
-- TOC entry 1534 (class 1259 OID 24694)
-- Dependencies: 1535 7
-- Name: acl_permission_permission_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_permission_permission_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_permission_permission_id_seq OWNER TO postgres;

--
-- TOC entry 1884 (class 0 OID 0)
-- Dependencies: 1534
-- Name: acl_permission_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_permission_permission_id_seq OWNED BY acl_permission.permission_id;


--
-- TOC entry 1885 (class 0 OID 0)
-- Dependencies: 1534
-- Name: acl_permission_permission_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_permission_permission_id_seq', 1, false);


--
-- TOC entry 1537 (class 1259 OID 24734)
-- Dependencies: 7
-- Name: acl_resource; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_resource (
    resource_id integer NOT NULL,
    resource_name character varying(255) NOT NULL
);


ALTER TABLE acl.acl_resource OWNER TO postgres;

--
-- TOC entry 1536 (class 1259 OID 24732)
-- Dependencies: 7 1537
-- Name: acl_resource_resource_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_resource_resource_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_resource_resource_id_seq OWNER TO postgres;

--
-- TOC entry 1886 (class 0 OID 0)
-- Dependencies: 1536
-- Name: acl_resource_resource_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_resource_resource_id_seq OWNED BY acl_resource.resource_id;


--
-- TOC entry 1887 (class 0 OID 0)
-- Dependencies: 1536
-- Name: acl_resource_resource_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_resource_resource_id_seq', 1, false);


--
-- TOC entry 1527 (class 1259 OID 24654)
-- Dependencies: 7
-- Name: acl_role; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_role (
    role_id integer NOT NULL,
    role_name character varying(255) NOT NULL
);


ALTER TABLE acl.acl_role OWNER TO postgres;

--
-- TOC entry 1526 (class 1259 OID 24652)
-- Dependencies: 7 1527
-- Name: acl_role_role_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_role_role_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_role_role_id_seq OWNER TO postgres;

--
-- TOC entry 1888 (class 0 OID 0)
-- Dependencies: 1526
-- Name: acl_role_role_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_role_role_id_seq OWNED BY acl_role.role_id;


--
-- TOC entry 1889 (class 0 OID 0)
-- Dependencies: 1526
-- Name: acl_role_role_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_role_role_id_seq', 3, true);


--
-- TOC entry 1539 (class 1259 OID 24742)
-- Dependencies: 7
-- Name: acl_user; Type: TABLE; Schema: acl; Owner: postgres; Tablespace: 
--

CREATE TABLE acl_user (
    user_id integer NOT NULL,
    user_name character varying(255) NOT NULL,
    user_password character varying(155) NOT NULL,
    user_dt_inicio time without time zone NOT NULL,
    user_ativo boolean NOT NULL,
    role_id integer NOT NULL
);


ALTER TABLE acl.acl_user OWNER TO postgres;

--
-- TOC entry 1538 (class 1259 OID 24740)
-- Dependencies: 1539 7
-- Name: acl_user_user_id_seq; Type: SEQUENCE; Schema: acl; Owner: postgres
--

CREATE SEQUENCE acl_user_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE acl.acl_user_user_id_seq OWNER TO postgres;

--
-- TOC entry 1890 (class 0 OID 0)
-- Dependencies: 1538
-- Name: acl_user_user_id_seq; Type: SEQUENCE OWNED BY; Schema: acl; Owner: postgres
--

ALTER SEQUENCE acl_user_user_id_seq OWNED BY acl_user.user_id;


--
-- TOC entry 1891 (class 0 OID 0)
-- Dependencies: 1538
-- Name: acl_user_user_id_seq; Type: SEQUENCE SET; Schema: acl; Owner: postgres
--

SELECT pg_catalog.setval('acl_user_user_id_seq', 3, true);


--
-- TOC entry 1540 (class 1259 OID 24753)
-- Dependencies: 1631 7
-- Name: view_login; Type: VIEW; Schema: acl; Owner: postgres
--

CREATE VIEW view_login AS
    SELECT au.user_name AS username, au.user_password AS password, ar.role_name AS role FROM (acl_user au JOIN acl_role ar ON ((ar.role_id = au.role_id)));


ALTER TABLE acl.view_login OWNER TO postgres;

SET search_path = menu, pg_catalog;

--
-- TOC entry 1542 (class 1259 OID 32952)
-- Dependencies: 8
-- Name: menu; Type: TABLE; Schema: menu; Owner: postgres; Tablespace: 
--

CREATE TABLE menu (
    menu_id integer NOT NULL,
    menu_name character varying(155) NOT NULL,
    menu_status boolean NOT NULL
);


ALTER TABLE menu.menu OWNER TO postgres;

--
-- TOC entry 1541 (class 1259 OID 32950)
-- Dependencies: 1542 8
-- Name: menu_menu_id_seq; Type: SEQUENCE; Schema: menu; Owner: postgres
--

CREATE SEQUENCE menu_menu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE menu.menu_menu_id_seq OWNER TO postgres;

--
-- TOC entry 1892 (class 0 OID 0)
-- Dependencies: 1541
-- Name: menu_menu_id_seq; Type: SEQUENCE OWNED BY; Schema: menu; Owner: postgres
--

ALTER SEQUENCE menu_menu_id_seq OWNED BY menu.menu_id;


--
-- TOC entry 1893 (class 0 OID 0)
-- Dependencies: 1541
-- Name: menu_menu_id_seq; Type: SEQUENCE SET; Schema: menu; Owner: postgres
--

SELECT pg_catalog.setval('menu_menu_id_seq', 3, true);


--
-- TOC entry 1544 (class 1259 OID 32960)
-- Dependencies: 8
-- Name: submenu; Type: TABLE; Schema: menu; Owner: postgres; Tablespace: 
--

CREATE TABLE submenu (
    submenu_id integer NOT NULL,
    submenu_name character varying(155) NOT NULL,
    submenu_status boolean NOT NULL,
    menu_id integer NOT NULL
);


ALTER TABLE menu.submenu OWNER TO postgres;

--
-- TOC entry 1543 (class 1259 OID 32958)
-- Dependencies: 1544 8
-- Name: submenu_submenu_id_seq; Type: SEQUENCE; Schema: menu; Owner: postgres
--

CREATE SEQUENCE submenu_submenu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE menu.submenu_submenu_id_seq OWNER TO postgres;

--
-- TOC entry 1894 (class 0 OID 0)
-- Dependencies: 1543
-- Name: submenu_submenu_id_seq; Type: SEQUENCE OWNED BY; Schema: menu; Owner: postgres
--

ALTER SEQUENCE submenu_submenu_id_seq OWNED BY submenu.submenu_id;


--
-- TOC entry 1895 (class 0 OID 0)
-- Dependencies: 1543
-- Name: submenu_submenu_id_seq; Type: SEQUENCE SET; Schema: menu; Owner: postgres
--

SELECT pg_catalog.setval('submenu_submenu_id_seq', 2, true);


SET search_path = public, pg_catalog;

--
-- TOC entry 1525 (class 1259 OID 16461)
-- Dependencies: 1824 6
-- Name: categoria; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE categoria (
    categoria_id integer NOT NULL,
    categoria_titulo character varying(255) NOT NULL,
    categoria_descricao character varying(255),
    categoria_ativo boolean DEFAULT true,
    categoria_ordem integer NOT NULL
);


ALTER TABLE public.categoria OWNER TO postgres;

--
-- TOC entry 1524 (class 1259 OID 16459)
-- Dependencies: 1525 6
-- Name: categoria_categoria_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE categoria_categoria_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.categoria_categoria_id_seq OWNER TO postgres;

--
-- TOC entry 1896 (class 0 OID 0)
-- Dependencies: 1524
-- Name: categoria_categoria_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE categoria_categoria_id_seq OWNED BY categoria.categoria_id;


--
-- TOC entry 1897 (class 0 OID 0)
-- Dependencies: 1524
-- Name: categoria_categoria_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('categoria_categoria_id_seq', 7, true);


SET search_path = acl, pg_catalog;

--
-- TOC entry 1828 (class 2604 OID 24686)
-- Dependencies: 1532 1533 1533
-- Name: action_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_action ALTER COLUMN action_id SET DEFAULT nextval('acl_action_action_id_seq'::regclass);


--
-- TOC entry 1827 (class 2604 OID 24673)
-- Dependencies: 1531 1530 1531
-- Name: controller_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_controller ALTER COLUMN controller_id SET DEFAULT nextval('acl_controller_controller_id_seq'::regclass);


--
-- TOC entry 1826 (class 2604 OID 24665)
-- Dependencies: 1529 1528 1529
-- Name: module_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_module ALTER COLUMN module_id SET DEFAULT nextval('acl_module_module_id_seq'::regclass);


--
-- TOC entry 1829 (class 2604 OID 24699)
-- Dependencies: 1535 1534 1535
-- Name: permission_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_permission ALTER COLUMN permission_id SET DEFAULT nextval('acl_permission_permission_id_seq'::regclass);


--
-- TOC entry 1830 (class 2604 OID 24737)
-- Dependencies: 1537 1536 1537
-- Name: resource_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_resource ALTER COLUMN resource_id SET DEFAULT nextval('acl_resource_resource_id_seq'::regclass);


--
-- TOC entry 1825 (class 2604 OID 24657)
-- Dependencies: 1527 1526 1527
-- Name: role_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_role ALTER COLUMN role_id SET DEFAULT nextval('acl_role_role_id_seq'::regclass);


--
-- TOC entry 1831 (class 2604 OID 24745)
-- Dependencies: 1538 1539 1539
-- Name: user_id; Type: DEFAULT; Schema: acl; Owner: postgres
--

ALTER TABLE acl_user ALTER COLUMN user_id SET DEFAULT nextval('acl_user_user_id_seq'::regclass);


SET search_path = menu, pg_catalog;

--
-- TOC entry 1832 (class 2604 OID 32955)
-- Dependencies: 1541 1542 1542
-- Name: menu_id; Type: DEFAULT; Schema: menu; Owner: postgres
--

ALTER TABLE menu ALTER COLUMN menu_id SET DEFAULT nextval('menu_menu_id_seq'::regclass);


--
-- TOC entry 1833 (class 2604 OID 32963)
-- Dependencies: 1543 1544 1544
-- Name: submenu_id; Type: DEFAULT; Schema: menu; Owner: postgres
--

ALTER TABLE submenu ALTER COLUMN submenu_id SET DEFAULT nextval('submenu_submenu_id_seq'::regclass);


SET search_path = public, pg_catalog;

--
-- TOC entry 1823 (class 2604 OID 16464)
-- Dependencies: 1524 1525 1525
-- Name: categoria_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE categoria ALTER COLUMN categoria_id SET DEFAULT nextval('categoria_categoria_id_seq'::regclass);


SET search_path = acl, pg_catalog;

--
-- TOC entry 1867 (class 0 OID 24683)
-- Dependencies: 1533
-- Data for Name: acl_action; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_action (action_id, action_name, controller_id) FROM stdin;
2	list	2
\.


--
-- TOC entry 1866 (class 0 OID 24670)
-- Dependencies: 1531
-- Data for Name: acl_controller; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_controller (controller_id, controller_name, module_id) FROM stdin;
2	categoria	1
\.


--
-- TOC entry 1865 (class 0 OID 24662)
-- Dependencies: 1529
-- Data for Name: acl_module; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_module (module_id, module_name) FROM stdin;
1	admin
3	library
\.


--
-- TOC entry 1868 (class 0 OID 24696)
-- Dependencies: 1535
-- Data for Name: acl_permission; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_permission (permission_id, permission_obs, role_id, module_id, controller_id, action_id, resource_id) FROM stdin;
\.


--
-- TOC entry 1869 (class 0 OID 24734)
-- Dependencies: 1537
-- Data for Name: acl_resource; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_resource (resource_id, resource_name) FROM stdin;
\.


--
-- TOC entry 1864 (class 0 OID 24654)
-- Dependencies: 1527
-- Data for Name: acl_role; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_role (role_id, role_name) FROM stdin;
1	admins
2	users
\.


--
-- TOC entry 1870 (class 0 OID 24742)
-- Dependencies: 1539
-- Data for Name: acl_user; Type: TABLE DATA; Schema: acl; Owner: postgres
--

COPY acl_user (user_id, user_name, user_password, user_dt_inicio, user_ativo, role_id) FROM stdin;
2	bob	e10adc3949ba59abbe56e057f20f883e	13:19:05.358	t	1
3	rob	e10adc3949ba59abbe56e057f20f883e	13:19:35.676	t	2
\.


SET search_path = menu, pg_catalog;

--
-- TOC entry 1871 (class 0 OID 32952)
-- Dependencies: 1542
-- Data for Name: menu; Type: TABLE DATA; Schema: menu; Owner: postgres
--

COPY menu (menu_id, menu_name, menu_status) FROM stdin;
2	Roles	t
3	Modules	f
\.


--
-- TOC entry 1872 (class 0 OID 32960)
-- Dependencies: 1544
-- Data for Name: submenu; Type: TABLE DATA; Schema: menu; Owner: postgres
--

COPY submenu (submenu_id, submenu_name, submenu_status, menu_id) FROM stdin;
2	Novos	t	2
\.


SET search_path = public, pg_catalog;

--
-- TOC entry 1863 (class 0 OID 16461)
-- Dependencies: 1525
-- Data for Name: categoria; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY categoria (categoria_id, categoria_titulo, categoria_descricao, categoria_ativo, categoria_ordem) FROM stdin;
7	Conclusão	Teste	t	56
\.


SET search_path = acl, pg_catalog;

--
-- TOC entry 1843 (class 2606 OID 24688)
-- Dependencies: 1533 1533
-- Name: action_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_action
    ADD CONSTRAINT action_id_ck PRIMARY KEY (action_id);


--
-- TOC entry 1841 (class 2606 OID 24675)
-- Dependencies: 1531 1531
-- Name: controller_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_controller
    ADD CONSTRAINT controller_id_ck PRIMARY KEY (controller_id);


--
-- TOC entry 1839 (class 2606 OID 24667)
-- Dependencies: 1529 1529
-- Name: module_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_module
    ADD CONSTRAINT module_id_ck PRIMARY KEY (module_id);


--
-- TOC entry 1845 (class 2606 OID 24701)
-- Dependencies: 1535 1535
-- Name: permission_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT permission_id_ck PRIMARY KEY (permission_id);


--
-- TOC entry 1847 (class 2606 OID 24739)
-- Dependencies: 1537 1537
-- Name: resource_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_resource
    ADD CONSTRAINT resource_id_ck PRIMARY KEY (resource_id);


--
-- TOC entry 1837 (class 2606 OID 24659)
-- Dependencies: 1527 1527
-- Name: role_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_role
    ADD CONSTRAINT role_id_ck PRIMARY KEY (role_id);


--
-- TOC entry 1849 (class 2606 OID 24747)
-- Dependencies: 1539 1539
-- Name: user_id_ck; Type: CONSTRAINT; Schema: acl; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY acl_user
    ADD CONSTRAINT user_id_ck PRIMARY KEY (user_id);


SET search_path = menu, pg_catalog;

--
-- TOC entry 1851 (class 2606 OID 32957)
-- Dependencies: 1542 1542
-- Name: menu_id_ck; Type: CONSTRAINT; Schema: menu; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY menu
    ADD CONSTRAINT menu_id_ck PRIMARY KEY (menu_id);


--
-- TOC entry 1853 (class 2606 OID 32965)
-- Dependencies: 1544 1544
-- Name: submenu_id; Type: CONSTRAINT; Schema: menu; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY submenu
    ADD CONSTRAINT submenu_id PRIMARY KEY (submenu_id);


SET search_path = public, pg_catalog;

--
-- TOC entry 1835 (class 2606 OID 16470)
-- Dependencies: 1525 1525
-- Name: categoria_id; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY categoria
    ADD CONSTRAINT categoria_id PRIMARY KEY (categoria_id);


SET search_path = acl, pg_catalog;

--
-- TOC entry 1859 (class 2606 OID 24717)
-- Dependencies: 1533 1535 1842
-- Name: action_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT action_id_fck FOREIGN KEY (action_id) REFERENCES acl_action(action_id);


--
-- TOC entry 1858 (class 2606 OID 24712)
-- Dependencies: 1531 1840 1535
-- Name: controller_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT controller_id_fck FOREIGN KEY (controller_id) REFERENCES acl_controller(controller_id);


--
-- TOC entry 1855 (class 2606 OID 24722)
-- Dependencies: 1533 1840 1531
-- Name: controller_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_action
    ADD CONSTRAINT controller_id_fck FOREIGN KEY (controller_id) REFERENCES acl_controller(controller_id);


--
-- TOC entry 1857 (class 2606 OID 24707)
-- Dependencies: 1535 1529 1838
-- Name: module_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT module_id_fck FOREIGN KEY (module_id) REFERENCES acl_module(module_id);


--
-- TOC entry 1854 (class 2606 OID 24727)
-- Dependencies: 1529 1531 1838
-- Name: module_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_controller
    ADD CONSTRAINT module_id_fck FOREIGN KEY (module_id) REFERENCES acl_module(module_id);


--
-- TOC entry 1860 (class 2606 OID 24757)
-- Dependencies: 1846 1535 1537
-- Name: resource_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT resource_id_fck FOREIGN KEY (resource_id) REFERENCES acl_resource(resource_id);


--
-- TOC entry 1856 (class 2606 OID 24702)
-- Dependencies: 1535 1836 1527
-- Name: role_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_permission
    ADD CONSTRAINT role_id_fck FOREIGN KEY (role_id) REFERENCES acl_role(role_id);


--
-- TOC entry 1861 (class 2606 OID 24748)
-- Dependencies: 1527 1539 1836
-- Name: role_id_fck; Type: FK CONSTRAINT; Schema: acl; Owner: postgres
--

ALTER TABLE ONLY acl_user
    ADD CONSTRAINT role_id_fck FOREIGN KEY (role_id) REFERENCES acl_role(role_id);


SET search_path = menu, pg_catalog;

--
-- TOC entry 1862 (class 2606 OID 32966)
-- Dependencies: 1544 1542 1850
-- Name: menu_id_fck; Type: FK CONSTRAINT; Schema: menu; Owner: postgres
--

ALTER TABLE ONLY submenu
    ADD CONSTRAINT menu_id_fck FOREIGN KEY (menu_id) REFERENCES menu(menu_id);


--
-- TOC entry 1877 (class 0 OID 0)
-- Dependencies: 6
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2011-04-02 14:32:58

--
-- PostgreSQL database dump complete
--

